const TerserPlugin = require('terser-webpack-plugin');

module.exports = {
  // ...
  optimization: {
    minimize: true,
    minimizer: [new TerserPlugin({
      terserOptions: {
        compress: {
          unused: true,
          dead_code: true,
          warnings: false,
          drop_debugger: true,
          drop_console: true
        },
        output: {
          comments: false
        }
      },
      extractComments: false
    })]
  }
};